package servlet;

import jakarta.servlet.*;

public class LogFilter implements Filter {
    public void init(FilterConfig config) throws ServletException {
        System.out.println("Param: " + config.getInitParameter("Param"));
    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException {
        System.out.println("doFilter");
        // 把请求传回过滤链
        chain.doFilter(request, response);
    }

    public void destroy() {
        /* 在 Filter 实例被 Web 容器从服务移除之前调用 */
    }
}